//案件数量统计柱状图
getCharts = function () {
    const chartBox = echarts.init(document.getElementById('case'), 'chalk');
    var birthData = [{
        name: '市容环境',
        birth1: 200,
        birth2: 2211
    },
        {
            name: '街面秩序',
            birth1: 130,
            birth2: 1586
        },
        {
            name: '宣传广告',
            birth1: 200,
            birth2: 1141
        }, {
            name: '园林绿化设施',
            birth1: 210,
            birth2: 104
        }, {
            name: '公用设施',
            birth1: 70,
            birth2: 86
        }, {
            name: '施工管理',
            birth1: 65,
            birth2: 340
        }, {
            name: '其他事件',
            birth1: 38,
            birth2: 569
        },
        {
            name: '交通设施',
            birth1: 153,
            birth2: 59
        },
        {
            name: '突发事件',
            birth1: 193,
            birth2: 9
        },
        {
            name: '市容环境设施',
            birth1: 200,
            birth2: 63
        },{
            name: '其他部件',
            birth1: 200,
            birth2: 1
        },
    ];
    let option = {
        grid: {
            top: '14%',
            left: '5%',
            right: '5%',
            bottom: '5%',
            containLabel: true,
        },
        tooltip: {
            trigger: 'axis',
            backgroundColor: 'rgba(50,50,50,0.7)',
            textStyle: {
                color: '#fff',
            }
        },
        dataset: {
            source: birthData
        },
        legend: {
            show: true,
            icon: 'circle',
            itemWidth: 30,
            right: 0,
            itemHeight: 14,
            textStyle: {
                fontSize: 18,
                color: '#E7EFFF',
                fontWeight: 400,
            }
        },
        xAxis: {
            type: 'category',
            offset: 10,
            axisLine: {
                show: true,
                lineStyle: {
                    color: '#0067E0',
                },
            },
            splitLine: {
                show: false,
            },
            axisLabel: {
                fontSize: 18,
                color: '#CFDFFF',
                fontWeight: 400,
                interval: 0,
                rotate: 40
            },
            axisTick: {
                show: false,
            },
        },
        yAxis: {
            type: 'value',
            nameTextStyle: {
                fontSize: 12,
                color: '#CFDFFF',
                fontWeight: 400,
            },
            axisLine: {
                show: false,
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: 'rgba(130, 147, 181, 0.5)',
                    type: 'dashed'
                },
            },
            axisLabel: {
                fontSize: 12,
                color: '#CFDFFF',
                fontWeight: 400,
            },
            axisTick: {
                show: false,
            },
        },
        series: [
            {
                name: '简易案件',
                type: 'bar',
                barWidth: 10,
                //颜色从上到下渐变
                itemStyle: {
                    normal: {
                        color: '#69DFAE'
                    }
                },

            },
            {
                name: '普通案件',
                type: 'bar',
                barWidth: 10,
                barGap: 0.4,
                itemStyle: {
                    normal: {
                        color: '#FFD15C'
                    }
                },
            },

        ],
    };
    chartBox.setOption(option)
    // 根据页面大小自动响应图表大小
    window.addEventListener("resize", function () {
        chartBox.resize();
    });


},

    //案件数量统计折线图
    initLines = function () {
        var chartDom = document.getElementById('exaradians');
        var myChart = echarts.init(chartDom);
        var option;

        option = {
            tooltip: {
                trigger: 'axis',
            },
            legend: {
                right: 0,
                data: ['简易案件', '普通案件'],
                textStyle: {
                    color: '#fff',
                    fontSize: 18
                },
                icon: 'rect',
                lineStyle: {
                    color: 'inherit',
                },
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true,
            },
            xAxis: [
                {
                    type: 'category',
                    boundaryGap: false,
                    axisLabel: {
                        formatter: [],
                        color: '#fff',
                    },
                    axisLine: {
                        lineStyle: {
                            color: '#CFDFFF',
                        },
                    },

                    data: [
                        '2023-01',
                        '2023-02',
                        '2023-03',
                        '2023-04',
                        '2023-05',
                        '2023-06',
                        '2023-07',
                        '2023-08',
                        '2023-09',
                    ],
                },
            ],
            yAxis: [
                {
                    color: '#fff',
                    axisLabel: {
                        formatter: [],
                        color: '#fff',
                    },
                    splitLine: {
                        lineStyle: {
                            color: 'rgba(255, 255, 255, 0.2)',
                        },
                    },
                },
            ],
            color: ['rgba(54, 240, 151, 1)', 'rgba(239, 200, 61, 1)'],
            series: [
                {
                    name: '简易案件',
                    type: 'line',

                    symbol: "none",
                    lineStyle: {
                        color: 'rgba(54, 240, 151, 1)',
                    },
                    emphasis: {
                        focus: 'series',
                    },
                    smooth: true,
                    areaStyle: {
                        normal: {
                            color: {
                                x: 0,
                                y: 0,
                                x2: 0,
                                y2: 1,
                                colorStops: [{
                                    offset: 1,
                                    color: "rgba(108,199,192,0)" // 0% 处的颜色
                                }, {
                                    offset: 0,
                                    color: "rgba(108,199,192,9)" // 100% 处的颜色
                                }],
                                globalCoord: false // 缺省为 false
                            }
                        }
                    },

                    data: [
                        2, 8, 26, 30, 20, 16,14,7,14
                    ],
                }, {
                    name: '普通案件',
                    type: 'line',

                    symbol: "none",
                    lineStyle: {
                        color: 'rgba(239, 200, 61, 1)',
                    },
                    emphasis: {
                        focus: 'series',
                    },
                    smooth: true,
                    areaStyle: {
                        normal: {
                            color: {
                                x: 0,
                                y: 0,
                                x2: 0,
                                y2: 1,
                                colorStops: [{
                                    offset: 1,
                                    color: "rgba(239, 200, 61, 0)" // 0% 处的颜色
                                }, {
                                    offset: 0,
                                    color: "rgba(239, 200, 61, 0.5)" // 100% 处的颜色
                                }],
                                globalCoord: false // 缺省为 false
                            }
                        }
                    },

                    data: [
                        4817, 8364, 9417, 8809, 9267,8653,8984,9219,6170
                    ],
                }
            ],
        }

        option && myChart.setOption(option);

    }

function initLinePie() {
    var chartDom = document.getElementById('pieRight');
    var myChart = echarts.init(chartDom);
    let datas = [{
        "name": "平板车",
        "value": 30
    }, {
        "name": "洒水车",
        "value": 28
    }, {
        "name": "小压缩车",
        "value": 21
    }, {
        "name": "小扫车",
        "value": 15
    }, {
        "name": "多功能车",
        "value": 13
    }, {
        "name": "钩臂车",
        "value": 11
    }, {
        "name": "侧翻车",
        "value": 11
    } , {
        "name": "洗扫车",
        "value": 8
    }, {
        "name": "干扫车",
        "value": 8
    }, {
        "name": "其他",
        "value": 25
    }]
    var option;
    option = {
        backgroundColor: 'transparent',
        "animation": true,
        "grid": {
            top: '1%',
            left: '5%',
            right: '5%',
            bottom: '5%',
            containLabel: true
        },
        "legend": [
            {
                orient: 'vertical',
                icon: 'circle',
                bottom: '0',
                right: 0,
                itemGap: 20,
                itemWidth: 8,
                itemHeight: 50,
                y: '60',
                x: '220',
                data: ['平板车', '洒水车', '小压缩车', '小扫车',
                '多功能车', '钩臂车', '侧翻车', '洗扫车', '干扫车', '其它',],
                "formatter": function (parms) {
                    const str = datas.filter(i => i.name === parms)
                    // return str[0].name + str[0].value;
                    return "{title|" + str[0].name + "} {value|" + (str[0].value) + "}"
                },
                textStyle: {
                    color: '#fff',
                    fontSize: 12,
                    align: 'right',
                    // 文字块背景色，一定要加上，否则对齐不会生效
                    backgroundColor: "transparent",
                    rich: {
                        b: {
                            width: 200,
                        },
                        value: {
                            color: 'rgba(101, 237, 255, 1)'
                        }
                    },
                },
            },
            {
                orient: 'vertical',
                icon: 'circle',
                bottom: '0',
                itemWidth: 8,
                itemHeight: 30,
                itemGap: 20,
                y: '190',
                x: '220',
                data: ['湿式散步车', '高空作业车', '生态环保车'],
                "formatter": function (parms) {
                    const str = datas.filter(i => i.name === parms)
                    return "{title|" + str[0].name + "} {value|" + (str[0].value) + "}"
                },
                textStyle: {
                    color: '#fff',
                    fontSize: 12,
                    align: 'left',
                    // 文字块背景色，一定要加上，否则对齐不会生效
                    backgroundColor: "transparent",
                    rich: {
                        value: {
                            color: 'rgba(101, 237, 255, 1)'
                        },
                        b: {
                            width: 200,
                        },
                    },
                },
            }
        ],
        "series": [{
            "type": "pie",
            "center": ["50%", "30%"],
            "radius": ["40%", "53%"],

            "color": ["#FEE449", "#00FFFF", "#00FFA8", "#9F17FF", "#FFE400", "#F76F01", "#F23F31"],
            "startAngle": 135,
            "label": {
                show: false
            },
            "labelLine": {
                show: false
            },
            "y": 100,
            "x": -100,
            "data": datas
        }, {
            "type": "pie",
            "center": ["50%", "30%"],
            "radius": ["35%", "36%"],
            "label": {
                "show": false
            },
            "y": 100,
            "x": -100,
            "data": [{
                "value": 78,
                "name": "实例1",
                "itemStyle": {
                    "normal": {
                        "color": {
                            "x": 0,
                            "y": 0,
                            "x2": 1,
                            "y2": 0,
                            "type": "linear",
                            "global": false,
                            "colorStops": [{
                                "offset": 0,
                                "color": "#9F17FF"
                            }, {
                                "offset": 0.2,
                                "color": "#01A4F7"
                            }, {
                                "offset": 0.5,
                                "color": "#FE2C8A"
                            }, {
                                "offset": 0.8,
                                "color": "#FEE449"
                            }, {
                                "offset": 1,
                                "color": "#00FFA8"
                            }]
                        }
                    }
                }
            }]
        }]
    }

    option && myChart.setOption(option);

}

//柱状折线图
function initLineBar() {
    var chartDom = document.getElementById('barLine');
    var myChart = echarts.init(chartDom);
    let bar3 = [
        {
            name: '一月',
            value: 3.3108,
            value2: 3.5051,
        },
        {
            name: '二月',
            value: 4.3206,
            value2: 2.7759,

        },
        {
            name: '三月',
            value: 5.1185,
            value2: 2.3048,

        },
        {
            name: '四月',
            value: 4.5166,
            value2: 2.0482,

        },
        {
            name: '五月',
            value: 4.5961,
            value2: 2.9953,

        },
        {
            name: '六月',
            value: 2.9939,
            value2: 2.5506,

        },
        {
            name: '七月',
            value: 1.1178,
            value2: 2.0800,

        },
        {
            name: '八月',
            value: 1.2412,
            value2: 2.2524,

        },
        {
            name: '九月',
            value: 0.0453,
            value2: 2.2704,

        },
    ];
    var option = {
        dataset: {
            source: bar3,
        },
        title: {
            // title为标题部分，有一级标题text，二级标题subtext。这里我们使用二级标题，再修改一下这个二级标题的位置即可出现我们想要的效果了，当然样式也可以通过title.subtextStyle去配置
            subtext: "单位（万个）",
            left: 12,// 距离左边位置
            top: 0,// 距离上面位置
            subtextStyle:{ // 设置二级标题的样式
              color:"#baf"
            }
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow',
            },
        },
        legend: {
            textStyle: { //图例文字的样式
                color: '#fff',
                fontSize: 20
            },
            data: [
                {
                    name: '累计收件量',
                },
                {
                    name: '累计办结量',
                }, {
                    name: '按期办结量',
                },
                {
                    name: '办结率',
                },
                {
                    name: '按期办结率',
                }
            ],
        },
        xAxis: [
            {
                type: 'category',
                axisLabel: {
                    textStyle: {
                        show: true,
                        color: '#fff',
                        fontSize: 20
                    }
                }

            }

        ],
        grid: {},
        yAxis: [
            {

                type: 'value',
                alignTicks: true,
                position: 'left',
                axisLine: {
                    show: true,
                },
                axisLabel: {
                    formatter: '{value}'+ '万个',
                    textStyle: {
                        show: true,
                        color: '#fff'
                    }
                },

            },
            {
                name: '单位:万',
                type: 'value',
                alignTicks: true,
                axisLine: {
                    show: true,
                },
                axisLabel: {
                    formatter: '{value} %',
                },
            },
        ],
        series: [
            {
                type: 'bar',
                name: '累计收件量',
                barWidth: 8,
                itemStyle: {
                    // color:'#fff',
                    normal: {
                        color: 'rgba(231, 234, 97, 1)',
                    },
                },
                encode: {
                    x: 'name',
                    y: 'value',
                },
            },
            {
                type: 'bar',
                name: '累计办结量',
                barWidth: 8,
                itemStyle: {
                    normal: {
                        color: 'rgba(0, 148, 255, 1)',
                    },
                },
                encode: {
                    x: 'name',
                    y: 'value2',
                },
            },
            // {
            //     type: 'bar',
            //     name: '按期办结量',
            //     barWidth: 8,
            //     itemStyle: {
            //         normal: {
            //             color: 'rgba(57, 220, 182, 1)',
            //         },
            //     },
            //     encode: {
            //         x: 'name',
            //         y: 'value3',
            //     },
            // },
            // {
            //     type: 'line',
            //     color: 'rgba(0, 148, 255, 1)',
            //     smooth: false,
            //     name: '办结率',
            //     symbolSize: 1,
            //     itemStyle: {
            //         normal: {
            //             color: 'rgb(231,159,9)',
            //         },
            //     },
            //     data: [1.01,
            //         6.4,
            //         4.5,
            //         4.5,
            //         6.5,
            //         8.5,
            //         18.6,
            //         18.14,0]
            // },
            // {
            //     type: 'line',
            //     smooth: false,
            //     color: 'rgba(57, 220, 182, 1)',
            //     name: '按期办结率',
            //     symbolSize: 1,
            //     itemStyle: {
            //         normal: {
            //             lineStyle: {

            //                 color: 'rgb(155,18,236)',
            //             },
            //         },
            //     },
            //     data: [10, 36, 29, 38, 95, 19],
            // },
        ],
    }


    option && myChart.setOption(option);

}

//
function initLineZhu() {
    var chartDom = document.getElementById('gunDongTop');
    var myChart = echarts.init(chartDom);
    var qysjbottom = "/asset/get/s/data-1638435346290-V95x4uUG6.png";

    var tick = "/asset/get/s/data-1638435304481-PS5i9afqe.png";

    let bjlxChartData = {areaName: ['苍南县', '瓯江口', '鹿城区', '龙湾区'], eventCount: [65, 3, 3, 3]};
    let max = Math.max(...bjlxChartData.eventCount);
    var maxArr = [];
    for (var i = 0; i < bjlxChartData.eventCount.length; i++) {
        maxArr.push(max);
    }
    let option = {
        animation: true,
        grid: {
            left: '3%',
            top: '5%',
            right: '3%',
            bottom: '0%',
            containLabel: true,
        },
        xAxis: [
            {
                show: false,
            },
        ],
        yAxis: [
            {
                axisTick: 'none',
                axisLine: 'none',
                inverse: true,
                offset: '10',
                axisLabel: {
                    inside: true,
                    textStyle: {
                        color: 'white',
                        fontSize: 16,
                        verticalAlign: 'bottom',
                        align: 'left',

                    },
                    formatter: function (value) {
                        // console.log(value);
                        return `{warnValue|}{value|${value}}`;
                    },

                    rich: {
                        //这里的rich，下面有解释
                        warnValue: {
                            //这里的warnValue对应上面的标签名
                            height: 40,
                            width: 10,
                            align: 'left',
                            color: 'white',
                            backgroundColor: {
                                image: tick, //这个warnImg是上面定义的图片var warnImg = "img/warn.png";
                            },
                        },
                        value: {
                            color: 'white',
                            fontSize: 16,
                        },
                    },
                },
                data: bjlxChartData.areaName,
            },
            {
                axisTick: 'none',
                axisLine: 'none',
                inverse: true,
                axisLabel: {
                    textStyle: {
                        color: 'white',
                        fontSize: 12,
                        // verticalAlign: "bottom",
                        align: 'right',
                    },
                    formatter: function (value, index) {
                        return `{value|${value}件}\n{img|}`;
                    },
                    rich: {
                        //这里的rich，下面有解释
                        img: {
                            //这里的warnValue对应上面的标签名
                            height: 2,
                            width: 20,
                            align: 'right',
                            color: 'white',
                            fontSize: 8,
                            backgroundColor: {
                                image: qysjbottom, //这个warnImg是上面定义的图片var warnImg = "img/warn.png";
                            },
                        },
                        value: {
                            align: 'right',
                            color: 'white',
                            marginLeft: 100,
                            fontSize: 16,
                        },
                    },
                },
                data: bjlxChartData.eventCount,
            },
            {
                axisLine: {
                    lineStyle: {
                        color: 'rgba(0,0,0,0)',
                    },
                },
                data: [],
            },
        ],
        series: [
            {
                name: '条',
                type: 'bar',
                stack: '圆',
                yAxisIndex: 0,
                // data: data,
                data: bjlxChartData.eventCount,
                barWidth: 8,
                itemStyle: {
                    normal: {
                        color: {
                            type: 'linear',
                            x: 0,
                            y: 0,
                            x2: 1,
                            y2: 0,
                            colorStops: [
                                {
                                    offset: 0,
                                    color: '#054B60', // 0% 处的颜色
                                },
                                {
                                    offset: 1,
                                    color: '#00FCFF', // 100% 处的颜色
                                },
                            ],
                        },
                        barBorderRadius: 10,
                    },
                },
                z: 2,
            },
            {
                name: 'XXX',
                type: 'pictorialBar',
                symbol:
                    'image://',
                symbolSize: [40, 40],
                symbolPosition: 'end',
                symbolOffset: [20, 0],
                z: 12,
                itemStyle: {
                    normal: {
                        color: '#fff',
                    },
                },
                data: bjlxChartData.eventCount,
            },
            {
                name: '背景',
                type: 'bar',
                barWidth: 8,
                barGap: '-100%',
                data: maxArr,
                itemStyle: {
                    normal: {
                        color: 'rgba(28, 128, 213, 0.19)',

                        barBorderRadius: 5,
                    },
                },
            },
        ],
    };


    option && myChart.setOption(option);

}

// 数字化折线图
getChartsZheD = function () {
    var chartDom = document.getElementById('caseTwos');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
        tooltip: {
            trigger: 'axis',
        },
        legend: {
            right: 0,
            data: ['今日', '昨日'],
            textStyle: {
                color: '#fff',
                fontSize: 18
            },
            icon: 'rect',
            lineStyle: {
                color: 'inherit',
            },
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true,
        },
        xAxis: [
            {
                type: 'category',
                boundaryGap: false,
                axisLabel: {
                    formatter: [],
                    color: '#fff',
                },
                axisLine: {
                    lineStyle: {
                        color: '#CFDFFF',
                    },
                },

                data: [
                    '6',
                    '7',
                    '8',
                    '9',
                    '10',
                    '11',
                    '12',
                    '13',
                    '14',
                    '15',
                    '16',
                    '17',
                ],
            },
        ],
        yAxis: [
            {
                color: '#fff',
                axisLabel: {
                    formatter: [],
                    color: '#fff',
                },
                splitLine: {
                    lineStyle: {
                        color: 'rgba(255, 255, 255, 0.2)',
                    },
                },
            },
        ],
        color: ['rgba(54, 240, 151, 1)', 'rgba(239, 200, 61, 1)'],
        series: [
            {
                name: '今日',
                type: 'line',

                symbol: "none",
                lineStyle: {
                    color: 'rgba(54, 240, 151, 1)',
                },
                emphasis: {
                    focus: 'series',
                },
                smooth: true,
                areaStyle: {
                    normal: {
                        color: {
                            x: 0,
                            y: 0,
                            x2: 0,
                            y2: 1,
                            colorStops: [{
                                offset: 1,
                                color: "rgba(108,199,192,0)" // 0% 处的颜色
                            }, {
                                offset: 0,
                                color: "rgba(108,199,192,9)" // 100% 处的颜色
                            }],
                            globalCoord: false // 缺省为 false
                        }
                    }
                },

                data: [
                    3,
                    41,
                    132,
                    88,
                    18,
                    6,
                    2,
                    1,
                    15,
                    2,
                    1,
                    1
                ],
            }, {
                name: '昨日',
                type: 'line',

                symbol: "none",
                lineStyle: {
                    color: 'rgba(239, 200, 61, 1)',
                },
                emphasis: {
                    focus: 'series',
                },
                smooth: true,
                areaStyle: {
                    normal: {
                        color: {
                            x: 0,
                            y: 0,
                            x2: 0,
                            y2: 1,
                            colorStops: [{
                                offset: 1,
                                color: "rgba(239, 200, 61, 0)" // 0% 处的颜色
                            }, {
                                offset: 0,
                                color: "rgba(239, 200, 61, 0.5)" // 100% 处的颜色
                            }],
                            globalCoord: false // 缺省为 false
                        }
                    }
                },

                data: [
                    0,
                    44,
                    94,
                    104,
                    12,
                    4,
                    3,
                    3,
                    9,
                    3,
                    1,
                    1
                ],
            }
        ],
    }

    option && myChart.setOption(option);
    myChart.setOption(option)
    // 根据页面大小自动响应图表大小
    window.addEventListener("resize", function () {
        myChart.resize();
    });


}
//滚动列表
var yearProgressData = [
    {
        name: '住房公积金',
        value: '16.6万',
        percent: '90',
        color: '#EF5533'
    },
    {
        name: '护照、通行证',
        value: '10.6万',
        percent: '80',
        color: '#FFC700'
    },
    {
        name: '户政',
        value: '9.6万',
        percent: '70',
        color: '#1BC47D'
    },
    {
        name: '社保',
        value: '8.6万',
        percent: '65',
        color: '#907CFF'
    },
    {
        name: '就业创业',
        value: '7.9万',
        percent: '55',
        color: '#0EC5FF'
    },
]
var today = [{name: '唐冶街道',value: '631',percent: '77',color: '#EF5533'},
{name: '东风街道',value: '480',percent: '56',color: '#EF5534'},
{name: '港沟街道',value: '442',percent: '49',color: '#EF5535'},
{name: '洪家楼街道',value: '433',percent: '49',color: '#EF5536'},
{name: '王舍人街道',value: '430',percent: '49',color: '#EF5537'},
{name: '彩石街道',value: '424',percent: '49',color: '#EF5538'},
{name: '全福街道',value: '420',percent: '49',color: '#EF5539'},
{name: '山大路街道',value: '398',percent: '42',color: '#EF5540'},
{name: '荷花路街道',value: '394',percent: '42',color: '#EF5541'},
{name: '华山街道',value: '385',percent: '42',color: '#EF5542'},
{name: '郭店街道',value: '361',percent: '42',color: '#EF5543'},
{name: '董家街道',value: '348',percent: '42',color: '#EF5544'},
{name: '鲍山街道',value: '320',percent: '36',color: '#EF5545'},
{name: '唐王街道',value: '288',percent: '30',color: '#EF5546'},]
var datachangeMap = {"yestoday1":[
    {name: '东风街道',value: '31',percent: '77',color: '#EF5533'},
    {name: '洪家楼街道',value: '25',percent: '63',color: '#EF5534'},
    {name: '港沟街道',value: '24',percent: '56',color: '#EF5535'},
    {name: '鲍山街道',value: '22',percent: '56',color: '#EF5536'},
    {name: '全福街道',value: '22',percent: '56',color: '#EF5537'},
    {name: '王舍人街道',value: '22',percent: '56',color: '#EF5538'},
    {name: '彩石街道',value: '21',percent: '49',color: '#EF5539'},
    {name: '唐冶街道',value: '21',percent: '49',color: '#EF5540'},
    {name: '荷花路街道',value: '20',percent: '49',color: '#EF5541'},
    {name: '郭店街道',value: '19',percent: '49',color: '#EF5542'},
    {name: '华山街道',value: '16',percent: '35',color: '#EF5543'},
    {name: '董家街道',value: '12',percent: '28',color: '#EF5544'},
    {name: '唐王街道',value: '10',percent: '21',color: '#EF5545'},
    {name: '山大路街道',value: '5',percent: '7',color: '#EF5546'},
    ],

    "week1":[
    {name: '唐冶街道',value: '120',percent: '84',color: '#EF5533'},
    {name: '港沟街道',value: '89',percent: '63',color: '#EF5534'},
    {name: '东风街道',value: '81',percent: '56',color: '#EF5535'},
    {name: '董家街道',value: '77',percent: '49',color: '#EF5536'},
    {name: '洪家楼街道',value: '75',percent: '49',color: '#EF5537'},
    {name: '全福街道',value: '74',percent: '49',color: '#EF5538'},
    {name: '王舍人街道',value: '73',percent: '49',color: '#EF5539'},
    {name: '彩石街道',value: '62',percent: '42',color: '#EF5540'},
    {name: '荷花路街道',value: '60',percent: '42',color: '#EF5541'},
    {name: '山大路街道',value: '60',percent: '42',color: '#EF5542'},
    {name: '鲍山街道',value: '57',percent: '35',color: '#EF5543'},
    {name: '郭店街道',value: '57',percent: '35.85817060637205',color: '#EF5544'},
    {name: '华山街道',value: '55',percent: '35.65262076053443',color: '#EF5545'},
    {name: '唐王街道',value: '33',percent: '21.39157245632066',color: '#EF5546'},
    ],

    "month1":[
    {name: '唐冶街道',value: '631',percent: '70.9662843239486',color: '#EF5533'},
    {name: '东风街道',value: '480',percent: '56.34202294056309',color: '#EF5534'},
    {name: '港沟街道',value: '442',percent: '49.68161279110184',color: '#EF5535'},
    {name: '洪家楼街道',value: '433',percent: '49.52519986096628',color: '#EF5536'},
    {name: '王舍人街道',value: '430',percent: '49.47306221758777',color: '#EF5537'},
    {name: '彩石街道',value: '424',percent: '49.36878693083073',color: '#EF5538'},
    {name: '全福街道',value: '420',percent: '49.2992700729927',color: '#EF5539'},
    {name: '山大路街道',value: '398',percent: '42.91692735488356',color: '#EF5540'},
    {name: '荷花路街道',value: '394',percent: '42.84741049704553',color: '#EF5541'},
    {name: '华山街道',value: '385',percent: '42.69099756690998',color: '#EF5542'},
    {name: '郭店街道',value: '361',percent: '42.27389641988182',color: '#EF5543'},
    {name: '董家街道',value: '348',percent: '42.04796663190824',color: '#EF5544'},
    {name: '鲍山街道',value: '320',percent: '35.56134862704206',color: '#EF5545'},
    {name: '唐王街道',value: '288',percent: '35.00521376433785',color: '#EF5546'},
    ],
    "yestoday2":[
        {name: '市容环境',value: '105',percent: '99.6344086021505',color: '#EF5533'},
        {name: '街面秩序',value: '67',percent: '95.0143369175627',color: '#EF5534'},
        {name: '宣传广告',value: '54',percent: '90.3548387096774',color: '#EF5535'},
        {name: '其他事件',value: '19',percent: '42.81003584229391',color: '#EF5536'},
        {name: '施工管理',value: '14',percent: '35.01792114695341',color: '#EF5537'},
        {name: '公用设施',value: '6',percent: '14.1505376344086',color: '#EF5538'},
        {name: '市容环境设施',value: '5',percent: '7.7921146953405',color: '#EF5539'},
        {name: '园林绿化设施',value: '4',percent: '7.4336917562724',color: '#EF5540'},
        {name: '交通设施',value: '4',percent: '7.4336917562724',color: '#EF5541'},
        {name: '突发事件',value: '1',percent: '1.3584229390681',color: '#EF5542'},
        ],

        "week2":[
        {name: '市容环境',value: '364',percent: '99.6565961732125',color: '#EF5533'},
        {name: '街面秩序',value: '265',percent: '90.686807653575',color: '#EF5534'},
        {name: '宣传广告',value: '179',percent: '80.0261832829809',color: '#EF5535'},
        {name: '其他事件',value: '80',percent: '56.0563947633434',color: '#EF5536'},
        {name: '施工管理',value: '54',percent: '35.4380664652568',color: '#EF5537'},
        {name: '园林绿化设施',value: '16',percent: '7.61127895266868',color: '#EF5538'},
        {name: '市容环境设施',value: '13',percent: '7.3091641490433',color: '#EF5539'},
        {name: '公用设施',value: '12',percent: '7.20845921450151',color: '#EF5540'},
        {name: '交通设施',value: '8',percent: '1.80563947633434',color: '#EF5541'},
        {name: '突发事件',value: '2',percent: '1.201409869083585',color: '#EF5542'},
        ],

        "month2":[
        {name: '市容环境',value: '2102',percent: '99.9132069024432',color: '#EF5533'},
        {name: '街面秩序',value: '1483',percent: '95.3374337946352',color: '#EF5534'},
        {name: '宣传广告',value: '1074',percent: '85.3495643259867',color: '#EF5535'},
        {name: '其他事件',value: '536',percent: '72.15769690756877',color: '#EF5536'},
        {name: '施工管理',value: '329',percent: '35.62104903468307',color: '#EF5537'},
        {name: '园林绿化设施',value: '100',percent: '7.70852554245686',color: '#EF5538'},
        {name: '公用设施',value: '84',percent: '7.43516145566376',color: '#EF5539'},
        {name: '市容环境设施',value: '61',percent: '7.04220058089868',color: '#EF5540'},
        {name: '交通设施',value: '56',percent: '5.956774303775841',color: '#EF5541'},
        {name: '突发事件',value: '9',percent: '4.153767298821117',color: '#EF5542'},
        {name: '其他部件',value: '1',percent: '2.0170852554245686',color: '#EF5543'},
        {name: '扩展部件',value: '1',percent: '2.0170852554245686',color: '#EF5544'},
        ],
        "yestoday3":[
            {name: '9:00',value: '104',percent: '99.2759856630824',color: '#EF5533'},
            {name: '8:00',value: '94',percent: '95.6917562724014',color: '#EF5533'},
            {name: '7:00',value: '44',percent: '80.7706093189964',color: '#EF5533'},
            {name: '10:00',value: '12',percent: '28.3010752688172',color: '#EF5533'},
            {name: '14:00',value: '9',percent: '35.2258064516129',color: '#EF5533'},
            {name: '11:00',value: '4',percent: '10.4336917562724',color: '#EF5533'},
            {name: '15:00',value: '3',percent: '10.0752688172043',color: '#EF5533'},
            {name: '13:00',value: '3',percent: '10.0752688172043',color: '#EF5533'},
            {name: '12:00',value: '3',percent: '10.0752688172043',color: '#EF5533'},
            {name: '23:00',value: '1',percent: '5.3584229390681',color: '#EF5533'},
            {name: '20:00',value: '1',percent: '5.3584229390681',color: '#EF5533'},
            {name: '16:00',value: '1',percent: '5.3584229390681',color: '#EF5533'},
            ],

            "week3":[
            {name: '8:00',value: '572',percent: '99.2140221402214',color: '#EF5533'},
            {name: '9:00',value: '376',percent: '94.7490774907749',color: '#EF5533'},
            {name: '7:00',value: '185',percent: '80.6531365313653',color: '#EF5533'},
            {name: '14:00',value: '79',percent: '50.83025830258303',color: '#EF5533'},
            {name: '10:00',value: '60',percent: '40.4280442804428',color: '#EF5533'},
            {name: '15:00',value: '27',percent: '10.99261992619926',color: '#EF5533'},
            {name: '13:00',value: '18',percent: '10.32841328413284',color: '#EF5533'},
            {name: '11:00',value: '17',percent: '10.25461254612546',color: '#EF5533'},
            {name: '12:00',value: '7',percent: '10.516605166051661',color: '#EF5533'},
            {name: '6:00',value: '6',percent: '10.44280442804428',color: '#EF5533'},
            {name: '23:00',value: '2',percent: '10.14760147601476',color: '#EF5533'},
            {name: '16:00',value: '2',percent: '10.14760147601476',color: '#EF5533'},
            {name: '17:00',value: '2',percent: '10.14760147601476',color: '#EF5533'},
            {name: '20:00',value: '1',percent: '10.0738007380073801',color: '#EF5533'},
            {name: '18:00',value: '1',percent: '10.0738007380073801',color: '#EF5533'},
            ],

            "month3":[
            {name: '8:00',value: '2506',percent: '99.6158833063209',color: '#EF5533'},
            {name: '9:00',value: '1876',percent: '95.4051863857374',color: '#EF5533'},
            {name: '7:00',value: '766',percent: '85.4149108589951',color: '#EF5533'},
            {name: '10:00',value: '308',percent: '40.99189627228525',color: '#EF5533'},
            {name: '14:00',value: '286',percent: '40.6353322528363',color: '#EF5533'},
            {name: '13:00',value: '143',percent: '20.31766612641815',color: '#EF5533'},
            {name: '11:00',value: '88',percent: '10.42625607779579',color: '#EF5533'},
            {name: '15:00',value: '79',percent: '10.28038897893031',color: '#EF5533'},
            {name: '6:00',value: '33',percent: '5.53484602917342',color: '#EF5533'},
            {name: '16:00',value: '19',percent: '5.307941653160454',color: '#EF5533'},
            {name: '12:00',value: '19',percent: '5.307941653160454',color: '#EF5533'},
            {name: '23:00',value: '15',percent: '5.243111831442464',color: '#EF5533'},
            {name: '18:00',value: '11',percent: '5.178282009724473',color: '#EF5533'},
            {name: '19:00',value: '9',percent: '5.145867098865478',color: '#EF5533'},
            {name: '0:00',value: '4',percent: '5.0648298217179903',color: '#EF5533'},
            {name: '17:00',value: '3',percent: '5.0486223662884927',color: '#EF5533'},
            {name: '22:00',value: '3',percent: '5.0486223662884927',color: '#EF5533'},
            {name: '20:00',value: '1',percent: '5.0162074554294976',color: '#EF5533'},
            {name: '21:00',value: '1',percent: '5.0162074554294976',color: '#EF5533'},
            ]
}
initProgress(today, $('.list-progress'))

function initProgress(data, dom) {
    var listHtml = ''
    var colorList = ['red', 'blue', 'yellow', 'green', 'pink']
    $.each(data, function (key, value) {
        // console.log(value.color)
        listHtml += ` <li>
    <div class="item">
      <div class="item-head">
        <div class="title">
        <span style="background:${value.color}">${key + 1}</span>
          ${value.name}
        </div>
        <div class="num">${value.value}</div>
      </div>
      <div class="item-progress">
        <div class="progress">
          <div class="progress-bar" style="width: ${value.percent}%"></div>
        </div>
      
      </div>
    </div>
  </li>`
        dom.html(listHtml)
    })
}

//地图点的坐标
let arrMap = [
    {
        level: 117.155297,
        vertical: 36.652975,
        icons: 'static/img/index/icons.png'
    }
]
//定义地图对象
var map;
var lineLayer;
var newlineLayer;
var popup = null;
mapData = function () {
    map = new OpenLayers.Map("mapDiv", {
        allOverlays: true,
        numZoomLevels: 20,
        slider: true,
        displayProjection: "EPSG:4490",
        controls: [
            new OpenLayers.Control.Navigation(),
            new OpenLayers.Control.ArgParser(),
            new OpenLayers.Control.Attribution()]
    });
    //创建矢量图层

    lineLayer = new OpenLayers.Layer.Vector("lineLayer");
    newlineLayer = new OpenLayers.Layer.Vector("newlineLayer");
    var graphicLayer = new OpenLayers.Layer.Vector("graphicLayer", {style: OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default'])});
    //影像图层初始化
    var sdimgLayer = new SDRasterLayer();
    //注记图层初始化
    var sdannoLayer = new SDRSAnnoLayer();
    var zoomctl = new OpenLayers.Control.PanZoomBar();
    map.addControl(zoomctl);
    map.addLayer(sdimgLayer);
    map.addLayer(lineLayer);
    map.addLayer(newlineLayer);
    map.addLayer(graphicLayer);
    map.addLayer(sdannoLayer);

    map.setCenter(new OpenLayers.LonLat(117.20, 36.7115), 12);
    for (let i = 0; i < jsonData.length; i++) {
       initBorder(jsonData[i], '')
    }
    map.events.on({"click": function (){
            if (popup) {
                console.log('调用')
                map.removePopup(popup);
            }
        }})
    //点击图标显示自定义弹出框
    var selectControl = new OpenLayers.Control.SelectFeature(lineLayer,{
        clickout: true,
        toggle: false,
        multiple: false,
        hover: false,
        toggleKey: "ctrlKey", // ctrl key removes from selection
        multipleKey: "shiftKey", // shift key adds to selection
        box: true
    })
    var selectControl1 = new OpenLayers.Control.SelectFeature(newlineLayer,{
        clickout: true,
        toggle: false,
        multiple: false,
        hover: false,
        toggleKey: "ctrlKey", // ctrl key removes from selection
        multipleKey: "shiftKey", // shift key adds to selection
        box: true
    })
    map.addControl(selectControl);
    selectControl.activate();

    map.addControl(selectControl1);
    selectControl1.activate();
}
//地图动态打点记录
var featureArray = [];
tuCeng = function (graphicLayer, v) {
    var pt = new OpenLayers.Geometry.Point(v.level, v.vertical);
    var style = {
        externalGraphic: v.icons,
        graphicWidth: 47,
        graphicHeight: 54
    };
    var feature = new OpenLayers.Feature.Vector(pt, v.data, style);
    featureArray.push(feature)
    graphicLayer.addFeatures([feature]);
}

//天气
function getWeather() {

    fetch('https://devapi.qweather.com/v7/weather/now?location=101120501&key=7d15d6b0c86e4d9e9e558223c22b4321', {
        type: 'get',
        dataType: 'json'
    }).then(response => {
        if (response.ok) return response.json()
    }).then(data => {
        $('#weathericon').addClass('qi-' + data.now.icon)
        $('#weather').text(data.now.text)
        $('#temp').text('' + data.now.temp + '℃')
        $('#wind').text(data.now.windDir + data.now.windScale + '级')
    })
}

getWeather()
$(function () {
    // 根据是否具有头部时间开启时间
    if ($('.header-datetime').length) {
        // 开启时间
        initTime();
    }
});
// 用户年龄分布
var ageData = [
    {
        name:'城市综合',
        value:4012,
        color:'#8F5CFF'
    },
    {
        name:'城乡建设',
        value:3707,
        color:'#002CFF'
    },
    {
        name:'住房与房地产',
        value:2618,
        color:'#00B4FF'
    },
    {
        name:'居民生活',
        value:1781,
        color:'#00FFD1'
    },
    {
        name:'社会事业',
        value:1553,
        color:'#9CFF00'
    },
    {
        name:'人力资源保障',
        value:1373,
        color:'#FFD300'
    },
    {
        name:'经济综合',
        value:1362,
        color:'#FD8500'
    },
    {
        name:'城市管理',
        value:1103,
        color:'#FF2727'
    },
    {
        name:'市容环境',
        value:1045,
        color:'#FF366F'
    },
    {
        name:'物业管理',
        value:945,
        color:'#C132EA'
    }

]

function initAge(data) {
    // console.log('22',data)
    const ageArr = []
    const colorArray = []
    data.forEach(item => {
        ageArr.push([item.name, item.value])
        colorArray.push(item.color)
    })
    var chart = Highcharts.chart('age', {
        chart: {
            type: 'pie',
            backgroundColor: 'transparent',
            options3d: {
                enabled: true,
                alpha: 55,
                beta: 0,

            }
        },
        colors: colorArray,
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        title: {
            enabled: false,
            text: '本月办理<br>进度比例',
            align: 'center',
            verticalAlign: 'middle',
            y: 25,
            style: {
                color: 'rgba(0,0,0,0)',
                fontWeight: '600'
            }

        },
        legend: {
            align: 'center',
            x: 0,
            verticalAlign: 'top',
            y: -10,

        },
        credits: {
            enabled: false
        },

        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                size: 200, // 设置饼图大小
                innerSize: 100,
                depth: 25,
                dataLabels: {
                    enabled: false,
                    color: '#fff',
                    format: `{point.name}<br/>{point.percentage:.1f}%`
                }
            }
        },
        series: [{
            type: 'pie',
            name: '本月办理进度比例',
            innerSize: "60%",
            data: ageArr,
        }],
    });
}

$().ready(function () {
    initAge(ageData)
})
var yearProgressData1 = [
    {
        name: '历城区',
        value: '935.95',
        percent: '98',
        color: '#EF5533'
    },
    {
        name: '历下区',
        value: '941.15',
        percent: '88',
        color: '#FFC700'
    },
    {
        name: '市中区',
        value: '937.15',
        percent: '78',
        color: '#1BC47D'
    },
    {
        name: '槐荫区',
        value: '934.87',
        percent: '68',
        color: '#907CFF'
    },
    {
        name: '天桥区',
        value: '926.03',
        percent: '58',
        color: '#0EC5FF'
    },
    {
        name: '济阳区',
        value: '926.4',
        percent: '58',
        color: '#0EC5FF'
    },
    {
        name: '章丘区',
        value: '920.4',
        percent: '58',
        color: '#0EC5FF'
    },
    {
        name: '南部山区',
        value: '925.14',
        percent: '58',
        color: '#0EC5FF'
    },
    {
        name: '商河县',
        value: '926.6',
        percent: '58',
        color: '#0EC5FF'
    },
    {
        name: '长清区',
        value: '923.17',
        percent: '58',
        color: '#0EC5FF'
    },
    {
        name: '钢城区',
        value: '924.2',
        percent: '58',
        color: '#0EC5FF'
    },
    {
        name: '莱芜区',
        value: '920.93',
        percent: '58',
        color: '#0EC5FF'
    },
    {
        name: '平阴县',
        value: '926.69',
        percent: '58',
        color: '#0EC5FF'
    },
    {
        name: '高新区',
        value: '932.72',
        percent: '58',
        color: '#0EC5FF'
    },
    {
        name: '起步区',
        value: '923.12',
        percent: '58',
        color: '#0EC5FF'
    }
]
var cityManage = {
    "city":[
        {
            name: '历城区',
            value: '935.95',
            percent: '98',
            color: '#EF5533'
        },
        {
            name: '历下区',
            value: '941.15',
            percent: '88',
            color: '#FFC700'
        },
        {
            name: '市中区',
            value: '937.15',
            percent: '78',
            color: '#1BC47D'
        },
        {
            name: '槐荫区',
            value: '934.87',
            percent: '68',
            color: '#907CFF'
        },
        {
            name: '天桥区',
            value: '926.03',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '济阳区',
            value: '926.4',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '章丘区',
            value: '920.4',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '南部山区',
            value: '925.14',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '商河县',
            value: '926.6',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '长清区',
            value: '923.17',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '钢城区',
            value: '924.2',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '莱芜区',
            value: '920.93',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '平阴县',
            value: '926.69',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '高新区',
            value: '932.72',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '起步区',
            value: '923.12',
            percent: '58',
            color: '#0EC5FF'
        }
    ],
    "area":[
        {
            name: '历城区',
            value: '935.95',
            percent: '98',
            color: '#EF5533'
        },
        {
            name: '历下区',
            value: '941.15',
            percent: '88',
            color: '#FFC700'
        },
        {
            name: '市中区',
            value: '937.15',
            percent: '78',
            color: '#1BC47D'
        },
        {
            name: '槐荫区',
            value: '934.87',
            percent: '68',
            color: '#907CFF'
        },
        {
            name: '天桥区',
            value: '926.03',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '济阳区',
            value: '926.4',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '章丘区',
            value: '920.4',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '南部山区',
            value: '925.14',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '商河县',
            value: '926.6',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '长清区',
            value: '923.17',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '钢城区',
            value: '924.2',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '莱芜区',
            value: '920.93',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '平阴县',
            value: '926.69',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '高新区',
            value: '932.72',
            percent: '58',
            color: '#0EC5FF'
        },
        {
            name: '起步区',
            value: '923.12',
            percent: '58',
            color: '#0EC5FF'
        }
    ]

}
initProgress1(yearProgressData1, $('.top-list'))

function initProgress1(data, dom) {
    var listHtml = ''
    var colorList = ['red', 'blue', 'yellow', 'green', 'pink']
    $.each(data, function (key, value) {
        // console.log(value.color)
        listHtml += ` <li>
    <div class="item">
      <div class="item-head">
        <div class="title">
        <span style="background:${value.color}">${key + 1}</span>
          ${value.name}
        </div>
        <div class="num">${value.value}</div>
      </div>
      <div class="item-progress" style="width: ${value.percent}%">
        
      </div>
    </div>
  </li>`
        dom.html(listHtml)
    })
}
function initBorder(val, name) {
    var bdary = val.geometry.coordinates[0][0];
    var pointArrays = new Array();
    for (var i = 0; i < bdary.length; i++) {
        var xyArr = bdary[i][0]
        var ptAr = bdary[i][1]
        pointArrays.push(new OpenLayers.Geometry.Point(xyArr, ptAr));
    }
    var liner = new OpenLayers.Geometry.LinearRing(pointArrays);
    var polygon = new OpenLayers.Geometry.Polygon([liner]);
    var style = {
        strokeColor: "#0071C3",
        strokeWidth: 4,
        fillColor: "#052444",
        fillOpacity: 0.5
    };
    var feature = new OpenLayers.Feature.Vector(polygon, name, style);
    lineLayer.addFeatures([feature]);
    addLabel();
}
var arrs = [
    {
        params: {
            name: "洪家楼",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.05447747257745,36.687112064113286]
    },
    {
        params: {
            name: "东风",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.08196480896315,36.69124676689813]
    },
    {
        params: {
            name: "鲍山",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.17184906982664,36.733821868955]
    },
    {
        params: {
            name: "彩石",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.29753853270722,36.59731536044518]
    },
    {
        params: {
            name: "董家",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.2596461858522,36.7575652595301]
    },
    {
        params: {
            name: "港沟",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.1803342761682,36.623071174834884]
    },
    {
        params: {
            name: "郭店",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.25266987868207,36.73483193154601]
    },
    {
        params: {
            name: "荷花路",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.11661469742265,36.773929894012475]
    },
    {
        params: {
            name: "华山",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.06072240222312,36.735240194390265]
    },
    {
        params: {
            name: "全福",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.07314064839288,36.70744556100673]
    },
    {
        params: {
            name: "山大路",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.05823307184225,36.67513482597145]
    },
    {
        params: {
            name: "唐王",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.29266445957472,36.8205511821609]
    },
    {
        params: {
            name: "唐冶",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.20345633200418,36.69092765718697]
    },
    {
        params: {
            name: "王舍人",
            value: [1, 2],
            target: 1
        },
        LngLat: [117.12785376972143,36.730552787121965]
    },
]
// 添加label
function addLabel() {
    var style = {
        externalGraphic: './static/img/index/addIcon.png',
        graphicWidth: 45,
        graphicHeight: 40
    };
    arrs.forEach((item, index) => {
        let label = {
            label: item.params.name,
            fontSize: "30px",
            fontColor: "#fff",
            // fontWeight: "bold"
        };
        let feature;
        if (item.params.name === '洪家楼') {
            feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(item.LngLat[0] - 0.025, item.LngLat[1]), null, label);
        } else {
            feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(item.LngLat[0] + 0.019, item.LngLat[1]), null, label);
        }
        let markers = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(item.LngLat[0], item.LngLat[1]), item.params.name, style);
        lineLayer.addFeatures([feature]);
        lineLayer.addFeatures([markers]);
    });
}
